<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
    <title>...</title>
</head>
<body>
<audio crossOrigin="anonymous" id="player" src=""></audio>
</body>
</html>
<script>
   var player=document.getElementById('player');
   
    var audioctx=new AudioContext;

    var audiosrc=audioctx.createMediaElementSource(player);
    var analyser=audioctx.createAnalyser();

    audiosrc.connect(analyser);
    analyser.connect(audioctx.destination);

   player.src='mp3s.php';
   // player.src="http://www.baidu190.com/api/str/kuwo.php/6206143";
   player.play();
    setInterval(()=>{
        console.log(player.currentTime,player.duration);
    },1000);
   

</script>